#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	long N = 0;
	scanf("%ld", &N);
	int count = 0;
	for (long i = 1; i <= N; i++)
	{
		long x = i;
		int tmp = 1;
        int count1 = 1;
		while (x)
		{
            
			if (count1 % 2 == 1)
			{
				if ((x % 10) % 2 == 0)
				{
					tmp = 0;
				}
			}
			else
			{
				if ((x % 10) % 2 == 1)
					tmp = 0;
			}
			if (tmp == 0)
				break;
			count1++;
			x /= 10;
		}
		if (tmp == 1)
			count++;
	}
	printf("%d", count);
	return 0;
}